/**
 * Created with IntelliJ IDEA.
 * Description:翻转二叉树
 * Date: 2024-02-04
 * Time:2:17
 */
public class invertTree {
/*
    public class TreeNode {
        int val;
        Solution1.TreeNode left;
        Solution1.TreeNode right;
        TreeNode() {}
        TreeNode(int val) { this.val = val; }
        TreeNode(int val, Solution1.TreeNode left, Solution1.TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }


    public TreeNode invertTree(TreeNode root) {
        if(root == null)
            return null;
        invert(root.left,root.right);
        return root;
    }

    public void invert(TreeNode root1,TreeNode root2) {
        if(root1 == null || root2 == null)
            return;
        invert(root1.left,root2.right);
        invert(root1.right,root2.left);
        int tmp = root1.val;
        root1.val = root2.val;
        root2.val = tmp;
    }
*/

}
